#include <stdio.h>
#include <math.h>
int main()
{
int a[100];
float b[100];
int max=0;
int min=100;
float aver=0;
float aver1=0.0;
int sum=0;
float sum1=0.0;
float max1=0.0;
float min1=100.0;
int i,j;
srand((unsigned)time(NULL));
for(i=0;i<100;i++)
{
a[i]=rand()%100;
sum+=a[i];
if(a[i]==0)
b[i]=0;
else
b[i]=1.0/a[i];
sum1+=b[i];
printf("%d  %d  %f\n",i,a[i],b[i]);
}
for(j=0;j<100;j++)
{

if(max<a[j])
max=a[j];
if(min>=a[j])
min=a[j];
if(max1<b[j])
max1=b[j];
if(min1>=b[j])
min1=b[j];
}
aver=sum/100;
aver1=sum1/100;
printf("max:%d    %f\n",max,max1);
printf("min:%d    %f\n",min,min1);
printf("ave:%f    %f\n",aver,aver1);
return 0;
}
